<?php

namespace common\service;

use common\model\TenantPositionModel;

class TenantPositionService
{
    /**
     * @var TenantPositionModel
     */
    private $modelObject;

    public function __construct()
    {
        $this->modelObject = model(TenantPositionModel::class);
    }

    /**
     * 查询
     * @param $param
     * @return array
     */
    public function select($param)
    {
        $res = [
            'rows' => [],
            'total' => 0,
        ];
        $res['total'] = $this->modelObject->where($param['filter'])->count();
        $res['rows'] = $this->modelObject->where($param['filter'])->page($param['page'][0], $param['page'][1])->order($param['order'])->select();
        return $res;
    }
}
